﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using DTcms.Common;
namespace DTcms.Web
{
    public partial class Responsibility : System.Web.UI.Page
    {
        protected DataTable dtMenu = null;
        protected string connnt = "";
        protected string id = "";
   
        protected void Page_Load(object sender, EventArgs e)
        {
            int _id = DTRequest.GetQueryInt("id");
            if (_id == 0)
            {
                _id = 75;

            }
                id = _id.ToString();

         
            rptTeam.DataSource = new BLL.article_category().GetList(74, 3);
            rptTeam.DataBind();

            if (_id != 0)
            {
                Model.article_category model = new BLL.article_category().GetModel(_id);
                Model.article_category modelP = new BLL.article_category().GetModel(model.parent_id);
                StringBuilder html = new StringBuilder();
                html.Append("<a href=\"/index.aspx\">主页</a>");
                if (modelP != null)
                {
                    html.Append("> <a href=\"" + modelP.link_url + "\">" + modelP.title + "</a>");
                }
                if (modelP != null)
                {
                    html.Append("> <a href=\"" + model.link_url + "\">" + model.title + "</a>");
                }
                memu.InnerHtml = html.ToString();
            }
              DataTable dtList = null;
            connnt = new BLL.article_category().GetModel(_id).content;
            dtList = new BLL.article().GetList(6,  "channel_id=3 and category_id=" + _id , "sort_id asc,add_time").Tables[0];
            StringBuilder strlist1 = new StringBuilder();
            StringBuilder strlist2 = new StringBuilder();
            for (int i = 0;i< dtList.Rows.Count; i++){
                if (i < 3)
                {
                    strlist1.Append("<a href=\"PaperDetail.aspx?id="+ dtList.Rows[i]["id"].ToString() + "\"><img src=\""+ dtList.Rows[i]["img_url"].ToString() + "\"><span class=\"abs\">"+ dtList.Rows[i]["title"].ToString() + "</span></a>");
                }
                else
                {
                    strlist2.Append("<a href=\"PaperDetail.aspx?id=" + dtList.Rows[i]["id"].ToString() + "\"><img src=\"" + dtList.Rows[i]["img_url"].ToString() + "\"><span class=\"abs\">" + dtList.Rows[i]["title"].ToString() + "</span></a>");
                }
            }
            list1.InnerHtml = strlist1.ToString();
            list2.InnerHtml = strlist2.ToString();

            ////rptTeamList2.DataSource = new BLL.article().GetList(3, "channel_id=2 and category_id in(select id from dt_article_category where parent_id=56)", "id");
            //Repeater1.DataBind();
            //Repeater2.DataSource = new BLL.article().GetList(3, "channel_id=3 and category_id=" + _id , "sort_id desc,add_time");
            ////rptTeamList2.DataSource = new BLL.article().GetList(3, "channel_id=2 and category_id in(select id from dt_article_category where parent_id=56)", "id");
            //Repeater2.DataBind();

        }


    
}
}